<%@page import="org.apache.commons.fileupload.RequestContext,java.util.*,fy.com.util.PageData"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>实时状态</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<%@ include file="../top.jsp" %>
	<%@ include file="../nav.jsp"%>
  </head>
  
  <body>
  <div style="width:95%;margin:2em;">
	<table id="table_report" class="table table-striped table-bordered table-hover">
		<thead>
			<tr>
				<th>时间</th>
				<th>温度</th>
				<th>湿度</th>
				<th>经度</th>
				<th>纬度</th>
				<th>高度</th>
				<th>气压</th>
				<th>烟雾</th>
				<th>红外</th>
				<th>紫外</th>
				<th>超声</th>
				<th>加速度(x,y,z三个方向)</th>
				<th>角速度(x,y,z三个方向)</th>
			</tr>
		</thead>
		<tbody>
		<!-- 开始循环 -->
			<c:choose>
				<c:when test="${not empty pd}">
				<% 
					List<PageData> list = (List<PageData>)request.getAttribute("pd") ;
					pageContext.setAttribute("a",list.size()-1);
				%>
				<tr>
					<td>${pd[a].data}</td>
					<td>${pd[a].temperature}</td>
					<td>${pd[a].humidity}</td>
					<td>${pd[a].longitude}</td>
					<td>${pd[a].latitude}</td>
					<td>${pd[a].height}</td>
					<td>${pd[a].air_pressure}</td>
					<td>${pd[a].smog}</td>
					<td>${pd[a].infrared_ray}</td>
					<td>${pd[a].ultraviolet_ray}</td>
					<td>${pd[a].ultrasonic_length}</td>
					<td>（${pd[a]. g_x}&sbquo;${pd[a]. g_y}&sbquo;${pd[a]. g_z}）</td>
					<td>（${pd[a]. j_x}&sbquo;${pd[a]. j_y}&sbquo;${pd[a]. j_z}）</td>
				</tr>
				</c:when>
			</c:choose>
		</tbody>
	</table>
</div>
</body>

</html>
